package com.gonsin.ta.logic.process;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.gonsin.ta.logic.enums.TaResult;
import com.gonsin.ta.logic.parse.condition.context.ChainContextImpl;
import com.google.gson.annotations.Expose;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
@ApiModel("Ta框架执行结果")
public class TaResponse {

    @ApiModelProperty("执行环境上下文")
    @JsonIgnore
    @Expose(serialize = false, deserialize = false)
    private transient ChainContextImpl context;

    @ApiModelProperty("执行结果")
    private TaResult result;

    @ApiModelProperty(value = "流程实例的id")
    private String instanceId;

    @ApiModelProperty(value = "等待的信号值", notes = "仅当流程脚本里面有WAIT方法的时候才会持久化流程实例，因为如果没有WAIT方法，执行会直到结束")
    public String getWaitingSignal(){
        return context.getWaitingSignal();
    }
}
